import pandas as pd

p = pd.Period('2012Q4', freq='Q-JAN')

#要获得该季度倒数第二个工作日下午四点钟的时间截，该怎么操作？
def calc():
    return (p.asfreq('B', 'e') - 1).asfreq('T', 's') + 16 * 60

def test_calc():
    ts = calc().to_timestamp()
    assert ts == pd.Timestamp('2012-01-30 16:00:00')
